/**
 * User: alesj
 * Date: 2005.6.1
 * Time: 15:35:08
 * 
 * (C) Genera Lynx d.o.o.
 */

package com.alesj.newsfeed.data;

import java.util.Date;
import java.util.Set;
import java.io.Serializable;

import com.generalynx.common.data.IEntity;
import com.generalynx.ecos.data.User;

public class Message implements IEntity, Cloneable, Serializable {

    private static final long serialVersionUID = 1L;

    private int id;
    private String subject;
    private boolean isHtml;
    private Account account;
    private String content;
    private int attachments;
    private Date creationTime;
    private User creator;
    private Set recepients;
    private Set failed;
    private Set criteria;

    public Object clone() {
        Message message = new Message();
        message.setSubject(subject);
        message.setHtml(isHtml);
        message.setAccount(account);
        message.setContent(content);
        message.setAttachments(attachments);
        message.setCreationTime(new Date());
        return message;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getSubject() {
        return subject;
    }

    public void setSubject(String subject) {
        this.subject = subject;
    }

    public boolean isHtml() {
        return isHtml;
    }

    public void setHtml(boolean html) {
        isHtml = html;
    }

    public Account getAccount() {
        return account;
    }

    public void setAccount(Account account) {
        this.account = account;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public int getAttachments() {
        return attachments;
    }

    public void setAttachments(int attachments) {
        this.attachments = attachments;
    }

    public Date getCreationTime() {
        return creationTime;
    }

    public void setCreationTime(Date creationTime) {
        this.creationTime = creationTime;
    }

    public User getCreator() {
        return creator;
    }

    public void setCreator(User creator) {
        this.creator = creator;
    }

    public Set getRecepients() {
        return recepients;
    }

    public void setRecepients(Set recepients) {
        this.recepients = recepients;
    }

    public Set getFailed() {
        return failed;
    }

    public void setFailed(Set failed) {
        this.failed = failed;
    }

    public Set getCriteria() {
        return criteria;
    }

    public void setCriteria(Set criteria) {
        this.criteria = criteria;
    }

    public String toString() {
        return getSubject() + " [" + getId() + "]";
    }

}
